#ifndef TESTER_TEST_H_
#define TESTER_TEST_H_


#include <cassert>

#include "exceptions.h"
#include "result.h"

#include "testmethod.h"
#include "globalsuite.h"

#include <list>

namespace Tester {
   class Test {
      private:
         typedef std::list<TestMethod*> List;
         List methods;
 
         const char *name;
         const char *file;

         unsigned int checkpointcounter;

         void init() ;
         void finish() ;

         void runTestMethod(TestMethod* testMethod, Result *result) ;

      protected:
         void assertTrue(bool stm, int line = -1);
         void assertFalse(bool stm, int line = -1);

         void checkpoint();

         virtual void setUp();
         virtual void tearDown();

         void add(TestMethod *testMethod) ;

      public:
         Test(const char *name, const char *file = 0);
         void run(Result *result) ;
         unsigned int checkpoint_count() const;
         virtual ~Test(); 
   };
}
#endif
